
package com.tool.btn;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.MouseEvent;
import org.come.Jpanel.TransJpanel;
import org.come.until.Util;

public class TransBtn extends MoBanBtn
{

	private TransJpanel transJpanel;
	private int p;

	public TransBtn(String iconpath, int type, int p, TransJpanel transJpanel)
	{
		super(iconpath, type);
		this.transJpanel = transJpanel;
		this.p = p;
	}

	public TransBtn(String iconpath, int type, Color colors[], Font font, String text, int p, TransJpanel transJpanel)
	{
		super(iconpath, type, colors);
		if (text != null)
		{
			setText(text);
			setFont(font);
			setVerticalTextPosition(0);
			setHorizontalTextPosition(0);
		}
		this.transJpanel = transJpanel;
		this.p = p;
	}


	@Override
    public void chooseyes()
	{
	}

	@Override
    public void chooseno()
	{
	}

	@Override
    public void nochoose(MouseEvent e)
	{
		if (p == 0 || p == 1) {
            transJpanel.cJpanelType(p);
        } else
		if (p == 2)
		{
			if (Util.isCanBuyOrno()) {
                return;
            }
			transJpanel.queDing();
		}
	}
}
